package com.example.demo.Controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-24
 * Time: 19:00
 */
@Controller
@ResponseBody
public class UserController {

    // 1. 获取日志对象
    private static final Logger log =
            LoggerFactory.getLogger("UserController");
    @RequestMapping("/sayhi")
    public void sayHi() {
        log.trace("这是 trace");
        log.debug("这是 debug");
        log.info("这是 info");
        log.warn("这是 warn");
        log.error("这是 error");
    }
}
